Skip to content

Slack token rotation#421

Open
gioccher wants to merge 13 commits intonautobot:developfrom
gioccher:slack-token-rotation
Open

Slack token rotation#421
gioccher wants to merge 13 commits intonautobot:developfrom
gioccher:slack-token-rotation

Conversation

@gioccher
Copy link

@gioccher gioccher commented Jan 6, 2026

Closes: #

What's Changed

Added support for slack automatic token rotation.
Token rotation is described here https://docs.slack.dev/authentication/using-token-rotation/ but the summary is that it replaces the static bot token with a pair of access and refresh tokens. Access expires every 12 hours, refresh is one-time use.
Some companies security policies require token rotation, and this PR makes nautobot chatops work for them.

To Do

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

yanshcodilime and others added 8 commits November 25, 2025 15:59
* Cookie updated by NetworkToCode Cookie Drift Manager Tool

Template:

```
{
    "template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
    "dir": "nautobot-app",
    "ref": "nautobot-app-v2.7.2",
    "path": null
}
```

Cookie:

```
{
    "remote": "https://github.com/nautobot/nautobot-app-chatops.git",
    "path": "/tmp/tmp_8i7076w/nautobot-app-chatops",
    "repository_path": "/tmp/tmp_8i7076w/nautobot-app-chatops",
    "dir": "",
    "branch_prefix": "drift-manager/ltm-2.4",
    "context": {
        "codeowner_github_usernames": "@glennmatthews @jvanderaa @smk4664 @whitej6",
        "full_name": "Network to Code, LLC",
        "email": "opensource@networktocode.com",
        "github_org": "nautobot",
        "app_name": "nautobot_chatops",
        "verbose_name": "Nautobot ChatOps App",
        "app_slug": "nautobot-chatops",
        "project_slug": "nautobot-app-chatops",
        "repo_url": "https://github.com/nautobot/nautobot-app-chatops",
        "base_url": "chatops",
        "camel_name": "NautobotChatOpsApp",
        "project_short_description": "Nautobot ChatOps App",
        "model_class_name": "CommandLog",
        "open_source_license": "Apache-2.0",
        "docs_base_url": "https://docs.nautobot.com",
        "docs_app_url": "https://docs.nautobot.com/projects/chatops/en/latest",
        "_extensions": [
            "local_extensions.camel_case_to_kebab",
            "local_extensions.camel_case_to_words",
            "local_extensions.NautobotVersions"
        ],
        "_template": "https://github.com/nautobot/cookiecutter-nautobot-app.git",
        "_output_dir": "/tmp/tmp_8i7076w",
        "_repo_dir": "/github/home/.cookiecutters/cookiecutter-nautobot-app/nautobot-app",
        "_checkout": "nautobot-app-v2.7.2"
    },
    "drift_managed_branch": "ltm-2.4",
    "remote_name": "origin",
    "pull_request_strategy": "PullRequestStrategy.UPDATE_OR_CREATE",
    "post_actions": [],
    "baked_commit_ref": "2587cbc785137e99ad553737141363017f123aef",
    "draft": false
}
```

CLI Arguments:

```
{
    "cookie_dir": "",
    "input": false,
    "json_filename": "",
    "output_dir": "",
    "push": true,
    "template": "",
    "template_dir": "",
    "template_ref": "nautobot-app-v2.7.2",
    "pull_request": "update-or-create",
    "post_action": [],
    "disable_post_actions": true,
    "draft": null,
    "drift_managed_branch": "ltm-2.4"
}
```

* Apply suggestion from @gsnider2195

---------

Co-authored-by: bakebot <info@networktocode.com>
Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants